home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolkit / vbof_v11 / demomari.cls < prev    next >
Text File  |  1996-03-01  |  2KB  |  87 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "MaritalStatus"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' the following pertain to being supported by
  11. '   VBOFCollection, VBOFObjectManager and
  12. '   VBOFEventManager
  13. Public ObjectID As Long
  14. Public ObjectChanged As Long
  15. Public ObjectAdded As Long
  16. Public ObjectDeleted As Long
  17. Public ObjectParentCount As Long
  18. Public ObjectManager As VBOFObjectManager
  19.  
  20. Public MaritalStatusCode As String
  21. Public Description As String
  22. Public Function ObjectSortCompare(Optional SortField As Variant, Optional SortOrder As Variant, Optional CompareObject As Variant) As Long
  23. ' Support the Collection.Sort method
  24. ' Note: use the ObjectManager.ObjectSortCompare
  25. '   method for assistance
  26.  
  27.     Select Case SortField
  28.         Case "GenderCode"
  29.             ObjectSortCompare = _
  30.                 ObjectManager.ObjectSortCompare( _
  31.                     Value1:=MaritalStatusCode, _
  32.                     Value2:=CompareObject.MaritalStatusCode, _
  33.                     SortOrder:=SortOrder)
  34.         
  35.         Case "CapitalCity"
  36.             ObjectSortCompare = _
  37.                 ObjectManager.ObjectSortCompare( _
  38.                     Value1:=Description, _
  39.                     Value2:=CompareObject.Description, _
  40.                     SortOrder:=SortOrder)
  41.     End Select
  42.  
  43. End Function
  44.  
  45.  
  46.  
  47. Public Function ObjectInitializeFromRecordSet(Optional RecordSet As Variant) As Address
  48. ' Populate my variables from the RecordSet
  49. '   (in support of VBOFCollection)
  50.  
  51.     On Local Error Resume Next
  52.     
  53.     MaritalStatusCode = RecordSet("MaritalStatusCode")
  54.     Description = RecordSet("Description")
  55.     
  56.     ObjectID = RecordSet("ObjectID")
  57.  
  58.     Set ObjectInitializeFromRecordSet = Me
  59. End Function
  60.  
  61. Public Function ObjectListBoxValue() As String
  62. ' Return a String will represent this object
  63. '   in a ListBox
  64. '   (in support of VBOFCollection)
  65.  
  66.     ObjectListBoxValue = _
  67.         MaritalStatusCode & " (" & Description & ")"
  68.  
  69. End Function
  70.  
  71. Public Function ObjectNewInstanceOfMyClass() As MaritalStatus
  72. ' Return a new instance of this class
  73. '   (in support of VBOFCollection)
  74.  
  75.     Set ObjectNewInstanceOfMyClass = New MaritalStatus
  76. End Function
  77.  
  78. Public Function ObjectDataSource() As String
  79. ' Return the Data Source with which this Class is associated
  80. '   (in support of VBOFCollection)
  81.     
  82.     ObjectDataSource = "MaritalStatusCodes"
  83. End Function
  84.  
  85.  
  86.  
  87.